﻿
CREATE PROCEDURE [dbo].[exbug_GenereazaExecutieCheltuieliTotal]
	-- Add the parameters for the stored procedure here
	@CodUnitate smallint, 
	@Data datetime,
	@ArtAl varchar(40),
	@IDJurnal int
AS
BEGIN
	SET NOCOUNT ON;

     SELECT SUM(Valoare) Total FROM [ExecutieCheltuieli] a WHERE 
     MONTH(a.Data)=Month(@Data) and YEAR(a.Data)=YEAR(@Data) and a.ArtAl = @ArtAl
     AND a.IDJurnal = @IDJurnal AND a.CodUnitate=@CodUnitate
END